export function searchColumns() {
  return [
    {
      span: 3,
      prop: 'email',
      placeholder: '请输入用户邮箱(账号)',
    },
    {
      span: 3,
      prop: 'channel',
      placeholder: '请输入渠道号',
    },
    {
      span: 3,
      prop: 'unique_id',
      placeholder: '请输入用户ID',
    },
    {
      span: 3,
      prop: 'country_name',
      type: 'select',
      dicData: this.countryList,
      filterable: true,
      typeformat(row) {
        return `(${row?.short_name}) ${row?.full_name}`
      },
      props: {
        value: 'id',
        label: 'full_name',
      },
      placeholder: '请选择国家',
    },
    {
      span: 3,
      prop: 'status',
      type: 'select',
      filterable: true,
      dicData: this.orderStatus,
      placeholder: '请选择订单状态',
    },

    {
      prop: 'dateRange',
      type: 'daterange',
    },
  ]
}

export function tableColumns() {
  return [
    {
      width: '80px',
      label: '序号',
      prop: 'id',
    },
    {
      align: 'left',
      label: '用户ID',
      prop: 'unique_id',
    },
    {
      label: '视频ID',
      prop: 'film_id',
    },
    {
      align: 'left',
      label: '视频名称',
      prop: 'film_name',
      width: 200,
      overHidden: true,
    },
    {
      label: '解锁的集',
      prop: 'film_episodes_no',
    },
    {
      width: '80px',
      label: '订单状态',
      prop: 'status',
      html: true,
      formatter: row =>
        `<span class="${
          row?.status === 1 ? 'text-primary' : row?.status === 2 ? 'text-danger' : 'text-success'
        }">${row?.status === 1 ? '待付款' : row?.status === 2 ? '已关闭' : '已完成'}</span>`,
    },
    {
      align: 'right',
      label: '金币',
      prop: 'coins',
      formatter: row => row?.coins / 10000,
    },
    {
      align: 'right',
      label: '奖金',
      prop: 'bonus',
      formatter: row => row?.bonus / 10000,
    },
    {
      align: 'right',
      width: 140,
      label: '支付金币',
      prop: 'coins',
      html: true,
      formatter: row => ` ${
        isNaN((row?.coins + row?.bonus) / 10000)
          ? row?.coins / 10000 || row?.bonus / 10000
          : (row?.coins + row?.bonus) / 10000
      }
        `,
    },
    {
      width: '140px',
      label: '支付时间',
      prop: 'payment_time',
      formatter: row => (row?.payment_time == 0 ? '--' : this.$formatTime(row?.payment_time)),
    },
    {
      label: '渠道',
      prop: 'channel_no',
    },
    {
      width: '80px',
      label: '国家',
      prop: 'country_name',
    },
    {
      label: 'IP',
      prop: 'ip',
      width: 140,
    },

    {
      label: 'APP版本',
      prop: 'app_version',
    },

    {
      align: 'left',
      label: '账号(邮箱)',
      prop: 'email',
    },
  ]
}
